<form name="addProfile" method="post" action="" enctype="multipart/form-data" onsubmit="return checkInput();">
	<table border="0" cellpadding="0" cellspacing="0" id="id-form">

		<p>
			<span style="color: red;"><strong>All fields * are required</strong> </span>

		</p>
		<br />

		<tr>

			<th valign="top">Profile name *</th>

			<td><input type="text" name="name" value="{name_val}" class="inp-form"  {disable}/></td> 
			<td>
				<div class="error-left"></div>
				<div class="error-inner"></div>
			</td>
		</tr>
		<tr>

			<th valign="top">Sessions_per_user *</th> 

			<td><input type="text" name="session" value="{session_val}" class="inp-form" /> &nbsp DEFAULT, UNLIMITED, OTHER</td> 
			<td>
				<div class="error-left"></div>
				<div class="error-inner"></div>
			</td>
		</tr>

		<tr>

			<th valign="top">Connect_time *</th> 

			<td><input type="text" name="connect" value="{connect_val}" class="inp-form" /> &nbsp DEFAULT, UNLIMITED, OTHER</td>
			<td>
				<div class="error-left"></div>
				<div class="error-inner"></div>
			</td>
		</tr>
		<tr>
			<th valign="top">Idle_time *</th> 

			<td><input type="text" name="idle" value="{idle_val}" class="inp-form" /> &nbsp DEFAULT, UNLIMITED, OTHER</td>
			<td>
				<div class="error-left"></div>
				<div class="error-inner"></div>
			</td>
		</tr>
		<tr>

			<th>&nbsp;</th>

			<td valign="top">

				<input name ="submit" type="submit" value="" class="form-submit" />

				<input name ="reset" type="reset" value="" class="form-reset"  />

			</td>

			<td></td>

		</tr>
		
	</table>
</form>

<script>
	$(document).ready(function(){
		$(".error-inner").each(function(){
			if($(this).html() == '') {
				$(this).css("visibility", "hidden");
				$(this).siblings(".error-left").css("visibility", "hidden");
			}
		});
	});
	
	$(document).ready(function(){
		
	 	$('form[name="addProfile"]').validate({
	    	rules: {
	    		name: { required: true},
				session: { required: true},
				connect: { required: true},
				idle: { required: true},
			},
			errorPlacement: function(error, element){
				$(element).parents('td').next().children(".error-inner").html(error);
										        
		        				
			},
			highlight: function(element, errorClass) {				
				$(element).parents('td').next().children(".error-left, .error-inner").css("visibility", "visible");
				
			},
			unhighlight: function(element, errorClass) {
				$(element).parent('td').next().children(".error-left, .error-inner").css("visibility", "hidden");
				
			}
		    
		});
	});
	
</script>